package com.example.yoho.mvp.view.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.yoho.R;
import com.example.yoho.domain.Domain_Url;
import com.example.yoho.mvp.model.entity.HomeGoodsEntity;
import com.example.yoho.utils.MyGlide;

import java.util.List;

public class MyHomeAdapter extends BaseQuickAdapter<HomeGoodsEntity.Values, BaseViewHolder> {





    public MyHomeAdapter(int layoutResId, @Nullable List<HomeGoodsEntity.Values> data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, HomeGoodsEntity.Values item) {
        ImageView imageView = helper.getView(R.id.image_goods);
        TextView textView_name=helper.getView(R.id.tv_goodsname);
        TextView textView_price=helper.getView(R.id.tv_goodsprice);
        MyGlide.GlideFor(mContext, Domain_Url.IMAGE_URL+item.goods_img_path,imageView);
        textView_name.setText(item.goods_name);
        textView_price.setText("￥"+item.goods_original_price);

    }
}
